import 'package:sow_app_core/sow_app_core.dart';
import 'package:sow_app_i18n/sow_app_i18n.dart';

import 'model/captcha_image_model.dart';

class AjaxCaptchaImageRepository implements CaptchaImageRepository {
  final RestClient client;

  AjaxCaptchaImageRepository(this.client);
  @override
  Future<Captcha> get() async {
    final response = (await client.getFile(I18n.captcha_url));
    return CaptchaImageModel.fromJson({"uuid": "1234", "img": response})
        .toEntity();
  }
}
